package com.ios.dto;

import com.ios.entity.Message;
import com.ios.enums.MessageStateEnum;

import java.util.List;

/**
*@Author:WenTao
*@Description:文章操作中间类型
*@Date:14:00 2018/7/19
*/
public class MessageExecution {
    /*结果状态*/
    private int state;
    /*状态标识*/
    private String stateInfo;
    /*文章*/
    private Message message;
    /*文章list*/
    private List<Message> messages;

    /*操作失败时的构造器*/
    public MessageExecution(MessageStateEnum stateEnum){
        this.state = stateEnum.getState();
        this.stateInfo = stateEnum.getStateInfo();
    }

    /*操作成功时的构造器*/
    public MessageExecution(MessageStateEnum stateEnum,Message message){
        this.state = stateEnum.getState();
        this.stateInfo = stateEnum.getStateInfo();
        this.message = message;
    }

    public MessageExecution(MessageStateEnum stateEnum,List<Message> messages){
        this.state = stateEnum.getState();
        this.stateInfo = stateEnum.getStateInfo();
        this.messages=messages;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public String getStateInfo() {
        return stateInfo;
    }

    public void setStateInfo(String stateInfo) {
        this.stateInfo = stateInfo;
    }

    public Message getMessage() {
        return message;
    }

    public void setMessage(Message message) {
        this.message = message;
    }

    public List<Message> getMessages() {
        return messages;
    }

    public void setMessages(List<Message> messages) {
        this.messages = messages;
    }
}
